1. Field of the Invention
The present invention relates to an authentication method and related device, and more particularly, to a method for performing authentication with a master device equipped with multiple operating systems in a Bluetooth system and related slave device.
2. Description of the Prior Art
Bluetooth system is a wireless short distance system with a piconet as the smallest network unit. The Bluetooth system utilizes time division duplex technology to allow a master device to transmit messages with at most seven active slave devices mutually. For data security and secrecy, an authentication procedure which is executed between the master device and the active slave devices is established on a challenge-response mechanism. The authentication end transmits a random number (regarded as a ┌challenge┘) to the demand end, and the demand end utilizes the random number, a link key of the demand end and some other parameters to calculate a ┌response┘ and then transmits the ┌response┘ back to the authentication end. Further, the authentication end also utilizes the random number, a link key of the authentication end and some other parameters to calculate a result with the same algorithm as used by the demand end. If the result is the same as the ┌response┘, it represents that the authentication succeeds. From the above, the authentication procedure is successful when the authentication end and the demand end have the same content of the link key. The master device and the active slave device both can be authentication end or demand end. Further, the master device and the active slave device authenticate with each other by playing the role of the authentication end in turn.
Please refer to FIG. 1, which illustrates a schematic diagram of a traditional Bluetooth system 10. In Bluetooth system 10, a host 100 can be devices such as a desktop computer, a laptop, a mobile communication device, etc and includes operating systems OS(1)-OS(n) and link keys LK(1)-LK(n) corresponding to the operating systems OS(1)-OS(n). The host 100 cannot access the link keys corresponding to the other operating systems when the host 100 is operated on one of the operating systems. A master device 110 can be a Bluetooth peripheral dangle such as a Bluetooth mouse, a earphone, an amplifier, etc and use a host controller interface (HCI), such as a universal serial bus (USB) interface, to exchange Bluetooth messages and commands with the host 100. Further, the HCI can be a Bluetooth wireless interface to communicate with Bluetooth peripheral devices of the host 100. In the Bluetooth system 10, an active slave device 120 can be regarded as the Bluetooth peripheral of the host 100, for example a Bluetooth mouse, a Bluetooth earphone, a Bluetooth amplifier, etc. The master device 110 utilizes a Bluetooth address BTA to establish an asynchronous connection-less (ACL) connection with the active slave device 120. After the connection establishment finishes, the master device 110 and the active slave device 120 have to execute an authentication procedure with each other. A key pairing procedure is executed to produce a new link key when any of the master device 110 and the active slave device 110 has no link key for authentication or the link key is invalid. In the active slave device 120, a non-volatile memory unit 122 stores the paired link key, i.e. the link key LKP, which corresponds to the Bluetooth address BTA with a “valid pointer” field for determining whether the link key LKP is valid. The active slave device 120 utilizes the link key LKP and the master device 110 utilizes the link key corresponding to the currently-used operating system operated by the host 100 to authenticate with each other. For example, the master device 110 obtains the link key LK(n) from the host 100 via the host controller interface to authenticate the active slave device 120 with the link key LKP when the host 100 is operated with the operating system OS(n).
In the Bluetooth system 10, the active slave device 120 is designed to store only one link key. Therefore, the old link key in the non-volatile memory unit 122 is replaced with a new link key each time when the new link key is produced by the key pairing procedure between the master device 110 and the active slave device 120 produces. However, each time when the host 100 with multiple operating systems reboots, the link key is always being replaced. In this situation, the master 110 and the active slave device 120 always authenticate failed with each other after the host changes the operating system and thereby need to re-pair the link key. For example, the host 100 operated in the operating system OS(1) communicates with the active slave device 120 for authenticated Bluetooth communication through the master device 110. In this situation, the master device 110 utilizes the link key LK(1) whose content is the same as content of the link key LKP of the non-volatile memory 122. Afterward, when the host 100 is rebooted and operated in the operating system OS(2), the master device 110 and the active slave device 120 must re-establish the connection and authenticate with each other. In this situation, the master device 110 obtains the link key LK(2) from the host 100, and the active slave device 120 obtains the link key LKP with the same content as the link key LK(1) for authenticating with each other. Because of different link key contents used by the master device 110 and the active slave device 120, the authentication procedure is failed and thereby causes the master device 110 and active slave device 120 to re-pair the link key. However, the key pairing procedure takes time and Bluetooth wireless resources.